import type { PatientItem, PatientParams } from '@/types/patient'
import { request } from "@/utils/request"

// 1. 添加用户接口
export const addPatientApi = (data: PatientParams) => {
  return request.post('/patient/add', data)
}

// 2. 获取用户列表接口
export const getPatientListApi = () => {
  return request.get<null, PatientItem[]>('/patient/mylist')
}

// 3. 删除用户接口
export const deletePatientApi = (id: string) => {
  return request.delete(`/patient/del/${id}`)
}

// 4. 获取用户详情接口
export const getPatientDetailApi = (id: string) => {
  return request.get<null, PatientItem>(`/patient/info/${id}`)
}

// 5. 修改用户接口
export const editPatientApi = (data: PatientParams) => {
  return request.put('/patient/update', data)
}